package com.idanchuang.component.logback.config;

import java.util.Map;

/**
 * @author yjy
 * @date 2019/12/31 18:08
 **/
public class LogbackMaskConfig {

    /** 启用日志脱敏 */
    private boolean enabled = false;
    /** 手机号脱敏 */
    private boolean maskMobile = false;
    /** 身份证号脱敏 */
    private boolean maskIdCard = false;
    /** 银行卡号脱敏 */
    private boolean maskBankNumber = false;
    /** 邮箱脱敏 */
    private boolean maskEmail = false;
    /** AK/SK脱敏 */
    private boolean maskAkSk = false;
    /** 自定义脱敏 */
    private boolean maskCustom = true;
    /** 日志被自动脱敏后, 是否将原始日志加密并追加在当前日志中 (手动脱敏的日志不会有原始日志) */
    private boolean keepOrigin = true;
    /** 自定义脱敏 匹配正则 -> 替换正则 */
    private Map<String, String> customMasks;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public boolean isMaskMobile() {
        return maskMobile;
    }

    public void setMaskMobile(boolean maskMobile) {
        this.maskMobile = maskMobile;
    }

    public boolean isMaskCustom() {
        return maskCustom;
    }

    public void setMaskCustom(boolean maskCustom) {
        this.maskCustom = maskCustom;
    }

    public boolean isMaskIdCard() {
        return maskIdCard;
    }

    public void setMaskIdCard(boolean maskIdCard) {
        this.maskIdCard = maskIdCard;
    }

    public boolean isMaskBankNumber() {
        return maskBankNumber;
    }

    public void setMaskBankNumber(boolean maskBankNumber) {
        this.maskBankNumber = maskBankNumber;
    }

    public boolean isMaskEmail() {
        return maskEmail;
    }

    public void setMaskEmail(boolean maskEmail) {
        this.maskEmail = maskEmail;
    }

    public boolean isMaskAkSk() {
        return maskAkSk;
    }

    public void setMaskAkSk(boolean maskAkSk) {
        this.maskAkSk = maskAkSk;
    }

    public Map<String, String> getCustomMasks() {
        return customMasks;
    }

    public void setCustomMasks(Map<String, String> customMasks) {
        this.customMasks = customMasks;
    }

    public boolean isKeepOrigin() {
        return keepOrigin;
    }

    public void setKeepOrigin(boolean keepOrigin) {
        this.keepOrigin = keepOrigin;
    }

    @Override
    public String toString() {
        return "LogbackMaskConfig{" +
                "enabled=" + enabled +
                ", maskMobile=" + maskMobile +
                ", maskIdCard=" + maskIdCard +
                ", maskBankNumber=" + maskBankNumber +
                ", maskEmail=" + maskEmail +
                ", maskAkSk=" + maskAkSk +
                ", keepOrigin=" + keepOrigin +
                ", maskCustom=" + maskCustom +
                ", customMasks=" + customMasks +
                '}';
    }
}
